package com.cn.mmd.service;

import com.cn.mmd.mapper.CourseMapper;
import com.cn.mmd.model.Course;
import com.cn.mmd.model.CourseExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2016/6/30 0030.
 */

@Service("courseService")
public class CourseServiceImpl implements  CourseService{

    @Autowired
    private CourseMapper courseMapper;

    @Override
    public Course selectByKey(String courseId) {
        return courseMapper.selectByKey(courseId);
    }

    @Override
    public int insertSelective(Course record) {
        return courseMapper.insertSelective(record);
    }

    @Override
    public List<Course> selectByExample(CourseExample example) {
        return courseMapper.selectByExample(example);
    }

    @Override
    public List<Course> selectByTeacher(String string) {
        return courseMapper.selectByTeacher(string);
    }

    @Override
    public Course selectClass(Course course) {
        return courseMapper.selectClass(course);
    }

    @Override
    public int updateByPrimaryKeySelective(Course record) {
        return courseMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<Course> selectByPaging(Course course) {
        return courseMapper.selectByPaging(course);
    }

    @Override
    public int deleteByPrimaryKey(String courseid) {
        return courseMapper.deleteByPrimaryKey(courseid);
    }

    @Override
    public int countLimitNum(Course course) {
        return courseMapper.countLimitNum(course);
    }

    /**
     * 通过班级名查询授课老师
     * @param className
     * @return
     */
    @Override
    public List<Course> selectTeacherByClass(String className){
        return courseMapper.selectTeacherByClass(className);
    }


    /**
     * 通过教师id名查询该教师所教的班级
     * @param teacherId
     * @return
     */
    @Override
    public List<Course> selectClassByTeacher(String teacherId){
        return courseMapper.selectClassByTeacher(teacherId);
    }

    @Override
    public List<Course> selectCollegeC() {
        return courseMapper.selectCollegeC();
    }

    @Override
    public List<Course> selectCourseByCollegeC(String s) {
        return courseMapper.selectCourseByCollegeC(s);
    }

}
